﻿using System;
using System.Collections.Generic;
using System.Text;
using MyHotel_BUSWS.MyHotel_PhongDAO_Webservice;
using MyHotel_BUSWS.MyHotel_LoaiPhongDAO_Webservice;
using MyHotel_BUSWS.MyHotel_PhieuThuePhongDAO_Webservice;
using MyHotel_BUSWS.MyHotel_KhachHangDAO_WebService;
using MyHotel_BUSWS.MyHotel_ChiTietPhieuThuePhongDAO_Webservice;
using MyHotel_BUSWS.MyHotel_PhieuDichVuDAO_Webservice;

namespace MyHotel_BUSWS
{
    public class MHPhieuThuePhongBUS
    {
        public static Phong[] getListPhong()
        {
            PhongDAOWSSoapClient ws = new PhongDAOWSSoapClient();
            Phong[] array = ws.getListPhong();
            return array;
        }

        public static Phong[] getListPhongTrong()
        {
            PhongDAOWSSoapClient ws = new PhongDAOWSSoapClient();
            Phong[] array = ws.getListPhongTrong();
            return array;
        }

        public static LoaiPhong getLoaiPhongbyTenPhong(string tenphong)
        {
            LoaiPhongDAOWSSoapClient ws = new LoaiPhongDAOWSSoapClient();
            return ws.getLoaiPhongbyTenPhong(tenphong);
        }

        public static bool themPhieuThuePhong(PhieuThuePhong phieuThue, KhachHang khachHang)
        {
            KhachHangDAOWSSoapClient wsKhachHang = new KhachHangDAOWSSoapClient();
            int IDKhachHang = wsKhachHang.themKhachHang(khachHang);
            if (IDKhachHang == 0)
                return false;

            phieuThue.MaKH = IDKhachHang;

            PhieuThuePhongDAOWSSoapClient wsPhieuThue = new PhieuThuePhongDAOWSSoapClient();
            return  wsPhieuThue.themPhieuThuePhong(phieuThue);  //Them Phieu Thue phong


        }


        public static PhieuDichVu[] getListDichVuByMaPhong(int maPhong)
        {
            PhieuDichVuDAOWSSoapClient ws = new PhieuDichVuDAOWSSoapClient();
            return ws.getListDichVuByMaPhong(maPhong);
        }
    }
}
